#!/bin/bash


num=$[RANDOM%100+1]

while :
do
read -p "请输入你猜的数："  n

y=$(echo $n|sed 's/[0-9]//g')
if [ -z  $y ];then

        if [ $n -eq $num ];then
                echo "你猜对了"
                exit
        elif [ $n -lt $num ];then
                echo "猜的小了"
        else
                echo "猜的大了"
        fi
else
        echo '输入的不是数字'
fi
done